/**
 *@Author Rain_tdk
 *@Date:  2018/11/26
 *@Description: mock数据
 *@ReviseAutor:
 *@ReviseDate:
 */
'use strict'
//引入mockjs
import loginData from './module/login'

const Mock = require('mockjs');
/**
 * 包装模拟数据
 * @param mockData
 * @param state
 * @param message
 * @returns {{data: *, state: number}}
 */
const getResponseData = (mockData = null, state = 200, message = '') => {
  const rpd = {
    data: mockData,
    state:state,
    message:message
  }
  return rpd
}

//登录接口
Mock.mock('/mock/api/login','post', (req, res) => {
  return getResponseData(loginData,200,'登录成功')
})
